class chartOption {
	stockLabelOption = {
		normal: {
			show: true,
			position: 'top',
			distance: 15,
			align: 'left',
			verticalAlign: 'middle',
			rotate: 90,
			formatter: '{c}',
			fontSize: 12,
			rich: {
				name: {
					textBorderColor: '#fff'
				}
			}
		}
	};

	SET_OPTIONS = {
		STOCK: {
			grid: {
				// width: '100%',
				left: 0
			},
			color: ['#01B0F0', '#72AC4D'],
			tooltip: {
				trigger: 'axis',
				axisPointer: {
					type: 'shadow'
				},
				position: ['50%', '50%']
			},
			legend: {
				selectedMode: false,
				data: ['统销业务', '市场化业务']
			},
			calculable: true,
			xAxis: [
				{
					type: 'category',
					axisTick: { show: false },
					axisLine: {
						lineStyle: { color: '#D0D1D2' }
					},
					axisLabel: {
						textStyle: {
							fontSize: 10,
							color: '#2A3E51'
						},
						interval: 0,  //解决x轴显示不全，设置这里
					},
					data: ['敞口库存（吨）', '上报敞口库存（吨）', '成交报告下单（吨）']
				}
			],
			yAxis: [
				{
					type: 'value',
					show: false
				}
			],
			series: [
				{
					name: '统销业务',
					type: 'bar',
					barGap: '80%',
					barWidth: 20,
					label: this.stockLabelOption,
					data: []
				},
				{
					name: '市场化业务',
					type: 'bar',
					barGap: '80%',
					barWidth: 20,
					label: this.stockLabelOption,
					data: []
				},
			]
		},
		PRICE: {
			color: ['#01B0F0', '#72AC4D'],
			tooltip: {
				trigger: 'axis',
				axisPointer: {            // 坐标轴指示器，坐标轴触发有效
					type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				},
				position: ['10%', '50%']
			},
			legend: {
				data: ['统销业务', '市场化业务']
			},
			grid: {
				left: 0,
				// right: '2%',
				bottom: '1%',
				containLabel: true
			},
			xAxis: {
				type: 'value',
				show: false
			},
			yAxis: {
				type: 'category',
				axisTick: { show: false }, //不显示y轴刻度
				axisLine: {
					lineStyle: { color: '#D0D1D2' }
				},
				axisLabel: {
					textStyle: {
						fontSize: 10,
						color: '#2A3E51'
					},
				},
				data: []
			},
			series: [
				{
					name: '统销业务',
					type: 'bar',
					stack: '总量',
					barGap: '80%',
					barWidth: 20,
					label: {
						normal: {
							show: true,
							position: 'inside'
						}
					},
					data: []
				},
				{
					name: '市场化业务',
					type: 'bar',
					stack: '总量',
					barGap: '80%',
					barWidth: 20,
					label: {
						normal: {
							show: true,
							position: 'inside'
						}
					},
					data: []
				},
			]
		},
		TYPESOCCUPATION: {
			title: {
				text: '类型占比',
				textAlign: 'center',
				textVerticalAlign: 'center',
				left: '50%',
				top: 'center',
				width: 30,
				textStyle: {
					fontSize: 14,
					fontWeight: 500,
				}
			},
			color: ['#FF777A', '#FFB707', '#01AFF1'],
			series: [
				{
					name: '访问来源',
					type: 'pie',
					radius: ['40%', '60%'],
					label: {
						normal: {
							formatter: '{d}% ',
							borderColor: '#aaa',
						},
						emphasis: {
							show: true,
							textStyle: {
								fontSize: '18',
								fontWeight: 'bold'
							}
						}
					},
					labelLine: {
						normal: {
							show: true
						}
					},
					itemStyle: {
						borderColor: '#fff',
						borderWidth: 4
					},
					data: []
				}
			]
		},
		DEPTOCCUPATION: {
			color: [],
			title: {
				text: '产品占比',
				textAlign: 'center',
				textVerticalAlign: 'center',
				left: '50%',
				top: 'center',
				width: 30,
				textStyle: {
					fontSize: 14,
					fontWeight: 500,
				}
			},
			series: [
				{
					name: '访问来源',
					type: 'pie',
					radius: ['40%', '60%'],
					label: {
						normal: {
							formatter: '{d}% ',
							borderColor: '#aaa',
						},
						emphasis: {
							show: true,
							textStyle: {
								fontSize: '18',
								fontWeight: 'bold'
							}
						}
					},
					labelLine: {
						normal: {
							show: true
						}
					},
					itemStyle: {
						borderColor: '#fff',
						borderWidth: 4
					},
					data: []
				}
			]
		}
	}

	OVERDUE_TYPE = {
		0: '已逾期',
		1: '1-3天逾期',
		2: '4-7天逾期'
	}
}

module.exports = new chartOption();